<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	// set集合实现了iterator接口，可实现扩展运算符和for...of
	let s = new Set();
	console.log(s,s instanceof Set)
	let s2 = new Set(['a','b','c','d']);
	console.log(s2)
	// 元素个数
	console.log(s2.size)
	// 添加新元素
	s2.add('e')
	console.log(s2)
	// 删除
	s2.delete('d')
	console.log(s2)
	// 检测
	console.log(s2.has('a'))
	// 遍历
	for(let v of s2){
		console.log(v)
	}
	// 清空
	s2.clear();
	console.log(s2)
</script>